 
import { useI18n } from 'vue-i18n'
import { useCustomParams } from '.'
import type { IJsonItem } from '../types'

export function useProcedure(model: { [field: string]: any }): IJsonItem[] {
  const { t } = useI18n()

  return [
    {
      type: 'editor',
      field: 'method',
      name: t('project.node.procedure_method'),
      props: {
        language: 'sql',
        placeholder: t('project.node.procedure_method_tips')
      },
      validate: {
        trigger: ['input', 'trigger'],
        required: true,
        message: t('project.node.procedure_method_tips')
      }
    },
    ...useCustomParams({ model, field: 'localParams', isSimple: false })
  ]
}
